Next | Prev | Up | Top | Contents | Index

Using Timers with the Frame Scheduler

In general, interval timers and the Frame Scheduler do not mix. The expiration of an interval is marked by a signal. However, signal delivery to an activity process can be delayed (see "Signal Delivery and Latency"), so timer latency is unpredictable.

An FRS control process, because it is scheduled by IRIX, not the Frame Scheduler, can use interval timers. However, it has a more reliable time base available in the activity processes it creates. The FRS controller can create a global semaphore on which it waits with uspsema() (see "IRIX Semaphores"). The minimal activity process shown in Example 7-7 can be enqueued to one or more minor frames to provide a repeating interval at any multiple of the major-frame interval.

Example 7-7 : Minimal Activity Process as a Timer

frs_join(scheduler-handle)
do {
   usvsema(frs-controller-wait-semaphore);
   frs_yield();
} while(1);
_exit();


Next | Prev | Up | Top | Contents | Index